-
Notifications
You must be signed in to change notification settings - Fork 720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server/leader: use the last modify revision to watch leader #1317
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nolouch
force-pushed
the
watch-revision
branch
2 times, most recently
from
November 8, 2018 14:05
1ba3c99
to
56e7a00
Compare
nolouch
force-pushed
the
watch-revision
branch
from
November 9, 2018 02:57
56e7a00
to
2e19bc3
Compare
disksing
reviewed
Nov 9, 2018
server/util.go
Outdated
@@ -83,6 +83,17 @@ func CheckPDVersion(opt *scheduleOption) { | |||
// A helper function to get value with key from etcd. | |||
// TODO: return the value revision for outer use. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the TODO?
rleungx
approved these changes
Nov 9, 2018
disksing
approved these changes
Nov 9, 2018
/run-all-tests |
rleungx
pushed a commit
to rleungx/pd
that referenced
this pull request
Nov 12, 2018
* server/leader: use the last modify revision to watch leader
nolouch
added
the
needs-cherry-pick-release-2.1
The PR needs to cherry pick to release-2.1 branch.
label
Nov 12, 2018
nolouch
added a commit
to nolouch/pd
that referenced
this pull request
Nov 12, 2018
* server/leader: use the last modify revision to watch leader
nolouch
added a commit
that referenced
this pull request
Nov 12, 2018
nolouch
added
needs-cherry-pick-release-2.0
The PR needs to cherry pick to release-2.0 branch.
and removed
needs-cherry-pick-release-2.0
The PR needs to cherry pick to release-2.0 branch.
labels
Nov 13, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
the watcher maybe loses some event without specified revision. In our election, there is a gap between
got leader key
andwatch the leader key
, if some event happens in this gap, like delete the leader key and write a new leader key, the watcher will lose those events, and cause the PD still think the leader is the old one.What is changed and how it works?
get the last modify revision and use it to watch.
Check List
Tests